﻿using System;
using LiSAClient.Core.Viewmodel;

namespace LiSAClient.Core.Interfaces
{
    public interface IPresenter
    {
        /// <summary>
        /// Present the viewmodel as the current content. Always performs OnPresented-action.
        /// </summary>
        /// <param name="content">ViewModel being presented.</param>
        void PresentContent(ContentViewModel content);

        /// <summary>
        /// Present the viewmodel as the current content. Performs OnPresented-action if set to true
        /// </summary>
        /// <param name="content">ViewModel being presented.</param>
        /// <param name="performOnPresented">Whether the OnPresented action should be performed</param>
        void PresentContent(ContentViewModel content, bool performOnPresented);

        /// <summary>
        /// Hide the current content of the presenter.
        /// </summary>
        void HideContent();

        /// <summary>
        /// Sends a closing request to the presenter.
        /// </summary>
        void SendClosingRequest();

        /// <summary>
        /// Handler executed once the closing request is performed.
        /// </summary>
        event EventHandler ClosingRequest;

        /// <summary>
        /// Starts a loading screen, preferably notifying the user via a loading bar.
        /// </summary>
        /// <param name="waitMessage">The message being shown during loading</param>
        void StartWaiting(string waitMessage);

        /// <summary>
        /// Updates the text shown on the loading screen.
        /// </summary>
        /// <param name="newMessage">The new message being shown during loading</param>
        void UpdateWaitText(string newMessage);

        /// <summary>
        /// Informs the presenter that the waiting is now over, and regular content can be shown.
        /// </summary>
        void FinishedWaiting();
    }
}
